import { View } from "../../../mvc/core/View";
import { LayerManager } from "../../manager/LayerManager";
import { ObjCreate } from "../common/ObjCreate";
import { ResFileConst } from "../../resource/ResFileConst";
import { SecTimerView } from "../common/SecTimerView";
import { GTextFormat } from "../../../common/GTextFormat";
import { FontUtil } from "../../../common/font/FontUtil";
import { FilterConst } from "../../../component/gconst/FilterConst";
import { EventName } from "../../mvc/EventName";
import { DataEvent } from "../../events/DataEvent";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { GLoadedButton } from "../../../../com/mui/controls/GLoadedButton";
type int = number;
//class MarryProcessIconView
    
    export  class MarryProcessIconView extends View
    {
        constructor()
        {
            super();
            this.layer = LayerManager.rightTopUILayer;
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            this._iconBtn = ObjCreate.createGLoadedButton(ResFileConst.MarryProcessBtn, 0, 0, 50, 50, this);
            this._iconBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onIconBtnClick);
            this._leftTime = new SecTimerView();
            this._leftTime.setParse("hh: mm: ss");
            this._leftTime.mouseEnabled = false;
            var loc1=new GTextFormat(FontUtil.songtiName, 12, 16580352);
            loc1.align = flash.text.TextFormatAlign.CENTER;
            this._leftTime.defaultTextFormat = loc1;
            this._leftTime.filters = [FilterConst.glowFilter];
            ObjCreate.setObjAttri(this._leftTime, -15, 55, 80, 20, this);
            this._leftTime.mouseEnabled = false;
            this._leftTime.addEventListener(EventName.SecViewTimeChange, this.onSecViewTimeChange);
            return;
        }

        /* internal  */onSecViewTimeChange(arg1: DataEvent): void
        {
            var loc1=int(arg1.data);
            if (loc1 == 0) 
            {
                this.hide();
            }
            return;
        }

        /* internal  */onIconBtnClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.MarryNPCMarryProcess));
            return;
        }

        public updateLeftTime(arg1: int): void
        {
            this._leftTime.setLeftTime(arg1);
            return;
        }

        /* internal */ /* var */_iconBtn: GLoadedButton;

        /* internal */ /* var */_leftTime: SecTimerView;
    }
